import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;

/**
 * De Scorecontroller laat scores zien op het scherm in een
 * JTable
 * @author Japie krekel
 *
 */

public class ScoreController extends JFrame implements ActionListener{	
	
	private JButton ok;
	
	public ScoreController(String [][] data, String[] kolom){
		setLayout(null);
		JTable tabel = new JTable(data, kolom);
		JScrollPane scrollPane = new JScrollPane(tabel);
		//tabel.setFillsViewportHeight(true);
		scrollPane.setBounds(0, 0, 798, 500);
		getContentPane().add(scrollPane);
		
		ok = new JButton("OK");
		ok.setBounds(360, 525, 80, 25);
		ok.addActionListener(this);
		getContentPane().add(ok);
		
		setSize(800, 600);
		setTitle("Score");
		setResizable(false);
		setVisible(true);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	}

	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == this.ok){
			dispose();
		}
	}
}